<?php

namespace App\Model\System;

use App\Model\Model;
use Hyperf\Database\Model\SoftDeletes;

/**
 * @property integer $id
 * @property text $content
 * @property integer $create_time
 * @property integer $update_time
 * @property integer $delete_time
 * @property string $version
 */
class SystemChangelog extends Model
{
    use SoftDeletes;

    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'system_changelog';

    protected $fillable = [
        'id',
        'content',
        'create_time',
        'update_time',
        'delete_time',
        'version',
    ];

    protected $appends = [
        'create_time_format',
    ];

    public function getCreateTimeFormatAttribute(){
        return $this->checkAttributes('create_time',function($create_time){
            return date('Y-m-d H:i',$create_time);
        });
    }
}
